//
//  BDUserModel.h
//  BadBoy
//
//  Created by 余勇 on 2017/3/8.
//  Copyright © 2017年 niusaibing. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <MJExtension/MJExtension.h>

typedef NS_ENUM(NSUInteger, BDLoginError) {
    BDLoginErrorGetFirendsListFailed        =20001,
    BDLoginErrorGetGroupsListFailed,
    BDLoginErrorLoginIMFailed,
    BDLoginErrorNotCompletionInfo
};

typedef NS_ENUM(NSUInteger, BDUserSixType) {
    BDUserSixTypeUnknow,
    BDUserSixTypeMale,
    BDUserSixTypeFemale,
    BDUserSixTypeOther
};

typedef NS_ENUM(NSUInteger, BDLoginType) {
    BDLoginTypePassword,
    BDLoginTypeVerificationCode,
    BDLoginTypeThirdPart
};

@interface BDUserModel : NSObject<NSCoding>

@property (nonatomic, assign) NSInteger user_id;
@property (nonatomic, strong) NSString *nickname;
@property (nonatomic, strong) NSString *email;
@property (nonatomic, strong) NSString *cover;
@property (nonatomic, assign) NSInteger status;
@property (nonatomic, assign) BOOL is_auth;
@property (nonatomic, strong) NSString *birthday;
@property (nonatomic, strong) NSString *true_name;
@property (nonatomic, strong) NSString *city;
@property (nonatomic, assign) BDUserSixType sex;
@property (nonatomic, assign) NSInteger address_id;
@property (nonatomic, strong) NSString *mobile;
@property (nonatomic, assign) NSInteger vip_level;
@property (nonatomic, assign) NSInteger vip_validity;
@property (nonatomic, strong) NSString *token_type;
@property (nonatomic, assign) NSInteger expires_in;
@property (nonatomic, strong) NSString *access_token;
@property (nonatomic, strong) NSString *refresh_token;
@property (nonatomic, strong) NSString *unique_id;
@property (nonatomic, assign) BOOL is_guest;
@property (nonatomic, assign) BOOL is_admin;
@property (nonatomic, assign) BOOL third_party;
@property (nonatomic, assign) BOOL is_agent;
@property (nonatomic, assign) NSInteger agent_city_id;
@property (nonatomic, assign) NSInteger mobile_city_id;
@property (nonatomic, strong) NSMutableArray *shops;
@property (nonatomic, assign) NSInteger shop_fav;
@property (nonatomic, assign) NSInteger posts;
@property (nonatomic, strong) NSString *ratio;
@property (nonatomic, assign) NSInteger limit;
@property (nonatomic, strong) NSString *mlm_ratio;
@property (nonatomic, assign) NSInteger mlm_limit;
@property (nonatomic, strong) NSDictionary *points;

@property (nonatomic, assign) float longitude;
@property (nonatomic, assign) float latitude;
@property (nonatomic, assign) float balance;

+ (void)loginUserWithAccount:(NSString *)account code:(NSString *)code loginType:(BDLoginType)loginType completionHandler:(BDBlockHandler)completionHandler;
+ (void)registWithPara:(NSMutableDictionary *)para completionHandler:(BDBlockHandler)completionHandler;
+ (void)completionInfoWithPara:(NSMutableDictionary *)para completionHandler:(BDBlockHandler)completionHandler;

//+ (BDUserModel *)creatWithFriendInfo:(BDFridentInfo *)friendInfo;
+ (BDUserModel *)getCurrentUser;
+ (NSString *)getHeaderValidation;
- (BOOL)saveCurrentUser;

- (void)saveTouristsUser;
+ (BDUserModel *)getTouristsUser;

+ (void)loginOut;

+ (void)getUserIfOverdueAfterBlock:(void(^)())afterBlock;
+ (void)judgeCurrentUserWithNormalBlock:(void(^)())normalBlock;
- (void)bindDeviceToken;
@end
